﻿using System.Text;

namespace Oxage.CNC.Models
{
	public abstract class XamlPathDataCodeInline : IMachineCodeInline
	{
		#region Constructors
		public XamlPathDataCodeInline()
		{
		}
		#endregion

		#region Public properties
		public char Code
		{
			get;
			set;
		}
		#endregion

		#region Public methods
		public abstract void Parse(string code);
		#endregion

		#region IMachineCodeInline Members
		public byte[] ToBytes()
		{
			return Encoding.ASCII.GetBytes(ToString());
		}

		public void FromBytes(byte[] data)
		{
			Parse(Encoding.ASCII.GetString(data));
		}
		#endregion
	}
}
